package cn.fx.org.domain;

import cn.fx.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel(value = "部门相关字段",description = "")
public class Department extends BaseDomain {

    //部门编号
    @ApiModelProperty(value = "部门编号")
    private String sn;

    //部门名称
    @ApiModelProperty(value = "部门名称")
    private String name;
    //部门路径
    private String dirPath;
    //部门状态：1启用,0禁用
    private Integer state = 1;

    //部门经理ID和部门经理
    private Long manager_id;
    private Employee manager;

    //上级部门ID和上级部门
    private Long parent_id;
    private Department parent;

    //上级部门下的子部门(多对一)  部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    List<Department> children = new ArrayList<>();

}
